<?php
use yii\widgets\ActiveForm;
use yii\helpers\Html;
use backend\extention_class\zhuji;
?>
<?php 
$form  = ActiveForm::begin([
		
		'enableClientScript'=>TRUE,
		'options'=>[
			'enctype'=>'multipart/form-data',
			'class'=>'form-horizontal'
		],
		'fieldConfig'=>[
			'template'=>'{label}<div class="col-sm-9">{input}{hint}<span class="help-inline col-xs-12 col-sm-7">{error}</span></div>',
			'labelOptions'=>['class'=>'col-sm-3 control-label no-padding-right'],
			'inputOptions'=>['class'=>'col-xs-10 col-sm-5'],
			'errorOptions'=>['class'=>'help-block middle']
		]		
]);
?>
<?= $form->field($supplierModel,'supplierid')->textInput(['value'=>$model->supplierid])?>
<?= $form->field($supplierModel,'suppliername')->textInput(['value'=>$model->suppliername,'id'=>'suppname'])?>
<?= $form->field($supplierModel,'supplierab')->textInput(['readonly'=>'readonly','value'=>$model->supplierab,'id'=>'suppab'])?>
<?= $form->field($supplierModel,'address')->textInput(['value'=>$model->address])?>
<?= $form->field($supplierModel,'linkname')->textInput(['value'=>$model->linkname])?>
<?= $form->field($supplierModel,'linktel')->textInput(['value'=>$model->linktel])?>
<?= $form->field($supplierModel,'qq')->textInput(['value'=>$model->qq])?>
<?= $form->field($supplierModel,'email')->textInput(['value'=>$model->email])?>
<?= $form->field($supplierModel,'sortid')->textInput(['value'=>$model->sortid])?>
<?= $form->field($supplierModel,'state')->radioList([
			'0'=>'不启用',
			'1'=>'启用'
])?>
<?= Html::input('hidden','id',$model->id)?>
<label class="col-sm-3 control-label no-padding-right" for="testform-age"></label>
<?= Html::submitButton('提交',[
		'class'=>'btn btn-danger'
		
]) ?>
&nbsp;&nbsp;&nbsp;&nbsp;
<?= Html::resetButton('重置',[
		'class'=>'btn btn-danger'
])?>

<?php 
$form = ActiveForm::end();
?>
<script>
$("#suppname").keyup(function(){
	var name = $(this).val();
	$.ajax({
		type:'post',
		url:"?r=purchase/supplierupdate",
		data:{
			action:'supplierab',
			name:name
		},
		dataType:'html',
		success:function(msg){
			$("#suppab").empty().val(msg)
		}
	});
}); 
</script>